import java.awt.Image;

import javax.swing.ImageIcon;

public class MenuItem {
	private int id, width, height, x, y;
	private Image background;
	private Menu parent;

	public MenuItem(Menu parent, int x, int y, int id, String bgPath) {
		this.parent = parent;
		this.x = x;
		this.y = y;

		this.id = id;

		ImageIcon ii = new ImageIcon(this.getClass().getResource(bgPath));
		background = ii.getImage();

		width = background.getWidth(null);
		height = background.getHeight(null);
	}

	/**
	 * Returns an Image object with the item background
	 * 
	 * @return the background of the menu item
	 */
	public Image getBackground() {
		return background;
	}

	/**
	 * Returns an int representing the items ID
	 * 
	 * @return the items ID
	 */
	public int getID() {
		return id;
	}

	/**
	 * Returns an int representing the x-position of the menu item
	 * 
	 * @return the x-position of the menu item
	 */
	public int getX() {
		return x;
	}

	/**
	 * Returns an int representing the y-position of the menu item
	 * 
	 * @return the y-position of the menu item
	 */
	public int getY() {
		return y;
	}

	/**
	 * Returns an int representing the width of the item
	 * 
	 * @return the width of the menu item
	 */
	public int getWidth() {
		// System.out.println(""+width);
		return width;
	}

	/**
	 * Returns an int representing the height of the item
	 * 
	 * @return the height of the menu item
	 */
	public int getHeight() {
		// System.out.println(""+height);
		return height;
	}
}
